import os
from urllib.parse import quote, unquote

if __name__ == '__main__':
    path = './test_file'
    if not os.path.exists(path) or not os.path.isdir(path):
        os.mkdir(path)

    # 写入
    with open('./test_file/a.txt', 'w') as f:
        f.write('123')

    # 读取和写入
    with open('./test_file/a.txt', 'r+') as f:
        f.write('456')

